#include<bits/stdc++.h>
using namespace std;

class Solution
{
private:
    /* data */
public:
    int climbStairs(int n){
        int dp1=1;
        int dp2=2;
        if(n==1){
            return 1;
        }
        if(n==2){
            return 2;
        }
        for(int i=3;i<=n;++i){
            int temp=dp2;
            dp2 = dp1 + dp2;
            dp1 = temp;
        }
        return dp2;
    }
};


int main(int argc, char const *argv[])
{
    Solution s;
    int res = s.climbStairs(3);
    cout<<res<<endl;
    return 0;
}
